package com.velthoven.umbraco4android;

import android.content.Context;
import android.os.Bundle;
import android.preference.PreferenceActivity;
import android.preference.PreferenceManager;

public class Preferences extends PreferenceActivity {
	private static final String OPT_SERVERURL = "serverurl_preference" ;
	private static final String OPT_USERNAME = "username_preference" ;
	private static final String OPT_PASSWORD = "password_preference" ;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(R.xml.settings);
	}
	
	public static String getServerUrl(Context context) {
		return PreferenceManager.getDefaultSharedPreferences(context).getString(OPT_SERVERURL, "");
	}
	
	public static String getUserName(Context context) {
		return PreferenceManager.getDefaultSharedPreferences(context).getString(OPT_USERNAME, "");
	}
	
	public static String getPassword(Context context) {
		return PreferenceManager.getDefaultSharedPreferences(context).getString(OPT_PASSWORD, "");
	}
}